package com.swinginwind.flexutils.components.timeComp.time.timeChooser
{
	
	import mx.collections.ArrayCollection;
	import mx.controls.LinkButton;
	
	import spark.components.BorderContainer;
	import spark.components.Label;
	import spark.layouts.HorizontalLayout;

	/**
	 * 描述: TimeChooser的标准标签
	 * @版权所有: horizo
	 * @创建者: caoww
	 * @创建日期: 2011-1-24 
	 * @修改者: 
	 * @修改日期: 
	 * @修改说明: 
	 */	
	internal class MethodTimeChooser 
	{
		public static const LABELWIDTH:uint=28;
		public static const LABELHEIGHT:uint=20;
		public function MethodTimeChooser()
		{
		}
		public static function createButton(label:String,title:Boolean=false):LinkButton{
			var btn:LinkButton=new LinkButton();
			btn.label=label;
			btn.setStyle("paddingLeft","0");
			btn.setStyle("paddingRight","0");
			if(title){
				btn.setStyle("fontWeight","bold");
			}
			btn.width=LABELWIDTH;
			return btn;
		}
		public static function createLabel(labelText:String):Label{
			var label:Label=new Label();
			label.text=labelText;
			label.width=22;
			label.setStyle("textAlign","center");
			return label;
		}
		public static function createMonthData():ArrayCollection{
			var arr:ArrayCollection=new ArrayCollection();
			for (var i:uint=1;i<=12;i++){
				arr.addItem(i);
			}
			return arr;
		}
		/**
		 * 获取年份数组，最大年份maxYear，最小年份minYear
		 */
		public static function createYearData(minYear:int,maxYear:int):ArrayCollection{
			var arr:ArrayCollection=new ArrayCollection();
			
			for(var i:int=minYear;i<=maxYear;i++)
				arr.addItem(i);
			return arr;
		}
		public static function createWeekData():Array{
			return ["日","一","二","三","四","五","六"];
		}
		public static function createRedBox():BorderContainer{
			var box:BorderContainer=new BorderContainer();
			box.width=LABELWIDTH;
			box.height=LABELHEIGHT;
			box.setStyle("borderColor","0xFF0000");
			box.setStyle("borderWeight","2");
			box.setStyle("backgroundAlpha","0");
			return box;
		}
		public static function createBorderBox():BorderContainer{
			var box:BorderContainer=new BorderContainer();
			var lay:HorizontalLayout=new HorizontalLayout();
			lay.paddingLeft=5;
			lay.paddingRight=5;
			lay.gap=0;
			lay.verticalAlign="middle";
			lay.horizontalAlign="center";
			box.layout=lay;
			box.setStyle("borderAlpha","0");
			box.percentWidth=100;
			box.height=33;
			return box;
		}
		
	}
}